package com.ylx.pojo;


import com.alibaba.fastjson.annotation.JSONType;

@JSONType(includes = {"goodsName", "categoryId", "description", "price", "unit"},
        orders = {"goodsName", "categoryId", "description", "price", "unit"})
public class Goods {
    private String id;

    public String getId () {
        return id;
    }

    public void setId (String id) {
        this.id = id;
    }

    private String goodsName;
    private String categoryId;
    private String description;
    private int price;
    private Integer status;
    private String creatime;

    @Override
    public String toString () {
        return "Goods{" +
                "id='" + id + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", categoryId='" + categoryId + '\'' +
                ", description='" + description + '\'' +
                ", price=" + price +
                ", status=" + status +
                ", creatime='" + creatime + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                ", unit='" + unit + '\'' +
                '}';
    }

    public String getCreatime () {
        return creatime;
    }

    public void setCreatime (String creatime) {
        this.creatime = creatime;
    }

    public Integer getStatus() {
        return status;
    }
    //逻辑视图
    public String getStatusStr(){
        if (status == null){
            return "未知";
        }
        return status == 0 ? "未上架":"已上架";
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getImgUrl () {
        return imgUrl;
    }

    public void setImgUrl (String imgUrl) {
        this.imgUrl = imgUrl;
    }

    private String imgUrl;

    public String getGoodsName () {
        return goodsName;
    }

    public void setGoodsName (String goodsName) {
        this.goodsName = goodsName;
    }

    public String getCategoryId () {
        return categoryId;
    }

    public void setCategoryId (String categoryId) {
        this.categoryId = categoryId;
    }

    public String getDescription () {
        return description;
    }

    public void setDescription (String description) {
        this.description = description;
    }

    public int getPrice () {
        return price;
    }

    public void setPrice (int price) {
        this.price = price;
    }

    public String getUnit () {
        return unit;
    }

    public void setUnit (String unit) {
        this.unit = unit;
    }


    private String unit;


}
